#ifndef _OSPFPACK_H_
#define _OSPFPACK_H

typedef struct _eth{
        unsigned char dmac[6];
        unsigned char smac[6];
        unsigned short proto;
}eth;

typedef struct _ip{
        unsigned char ver;
        unsigned char tos;
        unsigned short len;
        unsigned short id;
        unsigned char flags;
        unsigned char offest;
        unsigned char ttl;
        unsigned char proto;
        unsigned short checksum;
        unsigned int sip;
        unsigned int dip;
}ip;

typedef struct _ospfhea{
        unsigned char version;
        unsigned char type;
        unsigned short length;
        unsigned int routerid;
        unsigned int areaid;
        unsigned short checksum;
        unsigned short authtype;
        unsigned char auth[8];
}ospfhea;

typedef struct _ospfhel{
        unsigned int mask;
        unsigned short hello_int;
        unsigned char flags;
        unsigned char pri;
        unsigned int dead_int;
        unsigned int dr;
        unsigned int bdr;
        unsigned int nei[0];
}ospfhel;

typedef struct _ls{
	unsigned short lsage;
	unsigned char flags;
	unsigned char lstype;
	unsigned int lsid;
	unsigned int adv;
	unsigned int seq;
	unsigned short checksum;
	unsigned short len;
	unsigned char lsa[0];
}ls;

typedef struct _dbd{
	unsigned short mtu;
	unsigned char flags;
	unsigned char dbdflags;
	unsigned int seq;
}dbd;



unsigned char a2x(const char c);
extern void cpymac(unsigned char *mac,unsigned char*str);
extern int ip_cksum(void *data, int len);



#endif
